package start;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component("bBean")
public class B {
    public B() {
        System.out.println("Create " + this);
    }

    @Bean @Qualifier("public") @Scope(BeanDefinition.SCOPE_PROTOTYPE)
    public A publicInstance() {
        return new A("publicInstance");
    }
}
